package com.lb.service;

import com.lb.dao.BookMapper;
import com.lb.po.Books;

import java.util.List;

/**
 * 标题：类名称:BookServiceImpl
 * 说明：业务层调到层，service组合dao
 * 时间：2022/3/25 15:47
 * 作者 @author BGG
 */
public class BookServiceImpl implements BookService{


    private BookMapper bookMapper;

    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    @Override
    public int addBook(Books books) {
        return bookMapper.addBook(books);
    }

    @Override
    public int deleteBookById(int id) {
        return bookMapper.deleteBookById(id);
    }

    @Override
    public int updateBook(Books books) {
        return bookMapper.updateBook(books);
    }

    @Override
    public Books queryBookById(int id) {
        return bookMapper.queryBookById(id);
    }

    @Override
    public List<Books> queryAllBook() {
        return bookMapper.queryAllBook();
    }

    @Override
    public Books queryBookByName(String bookName) {
        return bookMapper.queryBookByName(bookName);
    }
}
